#ifndef _MY_XMODEM_H
#define _MY_XMODEM_H

#include "tools.h"
#include <string.h>

#define XMODEM_PACKET_SIZE 128  
#define XMODEM_SOH 0x01  
#define XMODEM_EOT 0x04  
#define XMODEM_ACK 0x06  
#define XMODEM_NAK 0x15  
#define XMODEM_CAN 0x18 

typedef struct
{
    char header;                   
    char packet_number;             
    char packet_number_c;            
    char data[XMODEM_PACKET_SIZE];   
    char check;                 
} xmodem_packet_t;

void get_xmodem_buf(FILE *file, xmodem_packet_t *xmodem_packet, size_t packet_num, char *buf);
// void send_xmodem_packet(xmodem_packet_t *pXmod, size_t packet_number, size_t packet_remain, char *send_buf);
// int send_xmodem_packet(const uint8_t *data); 
// void receive_xmodem();

#endif